package com.company.cloud.pay.modules.api.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.pay.modules.api.fallback.PayRemoteServiceFallbackFactory;
import com.company.cloud.pay.modules.api.request.PayOrderCancelRequest;
import com.company.cloud.pay.modules.api.request.PayOrderCloseRequest;
import com.company.cloud.pay.modules.api.request.PayOrderQueryRequest;
import com.company.cloud.pay.modules.api.request.PayOrderRequest;
import com.company.cloud.pay.modules.api.request.RefundOrderQueryRequest;
import com.company.cloud.pay.modules.api.request.RefundOrderRequest;
import com.company.cloud.pay.modules.api.response.PayOrderCancelResponse;
import com.company.cloud.pay.modules.api.response.PayOrderCloseResponse;
import com.company.cloud.pay.modules.api.response.PayOrderQueryResponse;
import com.company.cloud.pay.modules.api.response.PayOrderResponse;
import com.company.cloud.pay.modules.api.response.RefundOrderResponse;
import com.company.common.server.constant.ServiceNameConstant;


@FeignClient(contextId = "pay-center-1", name = ServiceNameConstant.pay_center, fallbackFactory = PayRemoteServiceFallbackFactory.class)
public interface PayRemoteService {

    /**
     * 统一下单
     */
    @PostMapping("/remote/pay/payOrderInfo")
    BaseClientResult<PayOrderResponse> payOrderInfo(@RequestBody PayOrderRequest request);

    /**
     * 统一下单：撤销
     */
    @PostMapping("/remote/pay/payOrderCancel")
    BaseClientResult<PayOrderCancelResponse> payOrderCancel(@RequestBody PayOrderCancelRequest request);

    /**
     * 统一下单：关闭
     */
    @PostMapping("/remote/pay/payOrderClose")
    BaseClientResult<PayOrderCloseResponse> payOrderClose(@RequestBody PayOrderCloseRequest request);

    /**
     * 支付查询
     */
    @PostMapping("/remote/pay/payOrderQuery")
    BaseClientResult<PayOrderQueryResponse> payOrderQuery(@RequestBody PayOrderQueryRequest request);

    /**
     * 退款申请
     */
    @PostMapping("/remote/pay/refundOrderInfo")
    BaseClientResult<RefundOrderResponse> refundOrderInfo(@RequestBody RefundOrderRequest request);

    /**
     * 退款查询
     */
    @PostMapping("/remote/pay/refundOrderQuery")
    BaseClientResult<RefundOrderQueryRequest> refundOrderQuery(@RequestBody RefundOrderQueryRequest request);

}
